package com.lucker.service.caipiaobettype;

import java.util.List;

import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;

import com.lucker.cds.model.CustomCaiPiaoBetType;
import com.lucker.ds.mapper.BaseCustomMapper;
import com.lucker.ds.model.CaiPiaoBetType;
import com.lucker.framework.exception.BaseServiceException;
import com.lucker.service.BaseServiceImpl;

@Service
public class CaiPiaoBetTypeServiceImpl extends BaseServiceImpl<CaiPiaoBetType, CustomCaiPiaoBetType, Long> implements CaiPiaoBetTypeService {

	@Override
	public BaseCustomMapper<CustomCaiPiaoBetType, Long> getCustomMapper() {
		return null;
	}
	
	public CaiPiaoBetType getCaiPiaoBetTypeByTypeId(Long typeId,int cai_type_id) {
		
		CaiPiaoBetType _caiPiaoBetType = new CaiPiaoBetType();
		_caiPiaoBetType.setCaiTypeId(String.valueOf(cai_type_id));
		_caiPiaoBetType.setTypeId(typeId);
		List<CaiPiaoBetType> list = queryAll(_caiPiaoBetType);
		
		if(CollectionUtils.isEmpty(list)) {
			throw new BaseServiceException("模拟投注玩法玩表 CaiPiaoBetType 没有维护完整");
		}
		
		return list.get(0);
	}

	

}
